package zz.note.rabbitmq.direct.listener;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Component;

/**
 * @Author: ZZ
 * @date 2022/2/11
 */
@RabbitListener(queues = "phone.direct.queue")
@Component
public class DirectPhoneService {
	// @RabbitHandler 代表此方法是一个消息接收的方法。该不要有返回值
	@RabbitHandler
	public void messagerevice(String message){
		// 此处省略发邮件的逻辑
		System.out.println("phone-------------->" + message);
	}
}
